import java.util.Scanner;
public class Main {
    public static void main0(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Long num1 = scanner.nextLong();
        long num2 = scanner.nextLong();
        long num3 = 2;
        if(num1<num2){
            long tem = num1;
            num1 = num2;
            num2 = tem;
        }
        long a =num1;
        long b = num2;
        while(num3!=0&&num3!=1){
            num3 = a%b;
            a = b;
            b = num3;
        }
        long i = num1*num2/a;
        System.out.println(a+i);
    }


        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int n = scanner.nextInt();
            int t = 4*(n/12)+2;
            System.out.println(t);

        }


}
